package pl.com.like.sequoia.web.service;

import pl.com.like.sequoia.dao.security.IUserDao;
import pl.com.like.sequoia.model.security.IUser;
import pl.com.like.sequoia.model.security.User;

/**
 * 
 * @author Pawel Wolanski Class keeps functionality to manage user(s).
 * 
 */
public class UserService implements IUserService {

	private IUserDao userDao;

	/** {@inheritDoc} */
	public User getUser(String login, String password) {
		User curUser = null;
		curUser = userDao.getUser(login, password);
		return curUser;
	}

	public IUserDao getUserDao() {
		return userDao;
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean isExistUser(String login) {
		IUser user = userDao.getUser(login, null);
		return (user != null);
	}

	/** {@inheritDoc} */
	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
	}

}
